class Solution {
public:
    vector<int> twoSum(vector<int>& nums, int target) {
        map<int, int> map;
        for(int i = 0; i < nums.size(); ++i){
            auto iterator = map.find(target - nums[i]);
            if(iterator != map.end()){
                return {iterator->second, i};
            } else {
                map.insert({nums[i], i});
            }
        }

        return {0,0};
    }
};